'use strict';
const db = uniCloud.database(); //代码块为cdb
const userCollection = db.collection("uni-id-users")
const uniID = require('uni-id')
exports.main = async (event, context) => {
  //event为客户端上传的参数
  const {
    username,
    password
  } = event
  // const res= await userCollection.add({user,password})
  const res = await uniID.register({
    username,
    password
  })
  // const res = await userCollection.get()
  //返回数据给客户端
  return res
};
